package com.oamicnet;

import com.oamicnet.entity.Student;
import com.oamicnet.service.StudentService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * Hello world!
 *
 */
public class App 
{
    public static void main( String[] args )
    {
        ApplicationContext context = new ClassPathXmlApplicationContext("applicationContext.xml");

        StudentService studentService = context.getBean("studentService", StudentService.class);
        Student student = new Student();
        student.setId(1);
        student.setName("zhangsan");
        student.setEmail("zhangsan@gmail.com");
        studentService.save(student);

        studentService.findById(11);
    }
}
